﻿<Window x:Class="SmartRoute.View.ProjectPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="SmartRoute Bus Route Optimizer" Height="902" Width="1116" ResizeMode="NoResize" >
    <Window.Resources>
        <HierarchicalDataTemplate DataType="School" ItemsSource="{Binding Path=Stops}"/>
    </Window.Resources>    
    <Grid MinHeight="640" MinWidth="800">
        <TabControl Margin="12,0,0,12" Name="projectTabControl">
            <TabItem Header="Welcome Screen" Name="welcomeTab">
                <Grid Height="708.475" Width="1020.204">
                    <Button Height="55" HorizontalAlignment="Right" Margin="0,0,6.668,6" Name="SaveButton" VerticalAlignment="Bottom" Width="113" Click="SaveButton_Click">Save Project</Button>
                    <Button Height="55" HorizontalAlignment="Right" Margin="0,0,125.025,6" Name="RunProject" VerticalAlignment="Bottom" Width="125" Click="RunProject_Click">Run Project</Button>
                    <Grid Margin="98.353,6,53.344,250.05" Name="grid1">
                        <Image Margin="71,25.005,6,40.008" Name="image1" Stretch="Fill" Source="SmartRouteLogo.JPG" />
                        <Label Margin="36.674,0,40.008,0" Name="label8" FontSize="32" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Height="53.723" VerticalAlignment="Bottom">Bus Route Optimizer</Label>
                    </Grid>
                </Grid>
            </TabItem>
            <TabItem Header="School Editor" Name="schoolTab">
                <Grid Height="546.25" Width="711.25">
                    <Rectangle Margin="350,26.25,21.25,0" Name="rectangle1" Stroke="Black" Height="125" VerticalAlignment="Top" />
                    <ComboBox Height="23" HorizontalAlignment="Left" Margin="6,60,0,0" Name="SchoolNameComboBox" VerticalAlignment="Top" Width="172" ItemsSource="{Binding Schools}" SelectionChanged="SchoolNameComboBox_SelectionChanged">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=SchoolName}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <ComboBox Height="23" HorizontalAlignment="Left" Margin="201,60,0,0" Name="StopComboBox" VerticalAlignment="Top" Width="142.5"  ItemsSource="{Binding Path=SelectedItem.Stops, ElementName=SchoolNameComboBox}" SelectionChanged="StopComboBox_SelectionChanged" />
                    <Label Height="28" HorizontalAlignment="Left" Margin="6,26.25,0,0" Name="label1" VerticalAlignment="Top" Width="120">School Name</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="201,26,0,0" Name="label2" VerticalAlignment="Top" Width="120">Stop</Label>
                    <TextBox Height="23" Margin="0,62.5,263,0" Name="NumPassengers" VerticalAlignment="Top" Visibility="Visible"  HorizontalAlignment="Right" Width="87" IsReadOnly="True" />
                    <Label Height="28" Margin="0,28.5,230,0" Name="label3" VerticalAlignment="Top" Visibility="Visible" HorizontalAlignment="Right" Width="120">Number of Passengers</Label>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,28.5,145,0" Name="label5" VerticalAlignment="Top" Width="70" Visibility="Visible">Latitude</Label>
                    <TextBox Height="23" HorizontalAlignment="Right" Margin="0,62.5,152.5,0" Name="Lat" VerticalAlignment="Top" Width="70" Visibility="Visible" IsReadOnly="True" />
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,26.25,36.25,0" Name="label4" VerticalAlignment="Top" Width="76.25" Visibility="Visible">Longitude</Label>
                    <TextBox Height="23" HorizontalAlignment="Right" Margin="0,61.25,36.25,0" Name="Long" VerticalAlignment="Top" Width="76.25" Visibility="Visible" IsReadOnly="True" />
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,110.5,36.25,0" Name="EditStop" VerticalAlignment="Top" Width="125" Click="EditStop_Click">Edit Stop</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,110.5,201.25,0" Name="DELETE" VerticalAlignment="Top" Width="121.25" Click="DELETE_Click" IsEnabled="False">Delete Stop</Button>


                    <Rectangle Margin="350,171.25,21.25,241.25" Name="rectangle2" Stroke="Black" Height="125"/>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,182.5,230,0" Name="label9" VerticalAlignment="Top" Visibility="Visible" Width="120">Number of Passengers</Label>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,182.5,145,0" Name="label10" VerticalAlignment="Top" Visibility="Visible" Width="70">Latitude</Label>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,180,36.25,0" Name="label11" VerticalAlignment="Top" Visibility="Visible" Width="76.25">Longitude</Label>
                    <TextBox Height="21.75" HorizontalAlignment="Right" Margin="0,215,263,0" Name="Pass2" VerticalAlignment="Top" Width="87" />
                    <TextBox Height="23" HorizontalAlignment="Right" Margin="0,215,152.5,0" Name="Lat2" VerticalAlignment="Top" Width="70" />
                    <TextBox Height="23" HorizontalAlignment="Right" Margin="0,213.75,36.25,0" Name="Long2" VerticalAlignment="Top" Width="76.25" />
                    <Button HorizontalAlignment="Right" Margin="0,262.5,36.25,261.25" Name="AddStopToSchool" Width="125" Click="AddStopToSchool_Click">Add Stop To School</Button>
                </Grid>
            </TabItem>
            <TabItem Header="Algorithm Editor" Name="algorithmTab">
                <Grid>
                    <Label Height="28" HorizontalAlignment="Left" Margin="71,23.25,0,0" Name="BusCostDisplay" VerticalAlignment="Top" Width="138" Content="{Binding Path=BusCost}" />
                    <Slider Height="21.75" Margin="215,26.25,20,0" Name="BusCostSlider" VerticalAlignment="Top" Maximum="5000" TickFrequency="50" SmallChange="10" LargeChange="100" Value="{Binding Path=BusCost}" TickPlacement="TopLeft" />
                    <Label Height="25" HorizontalAlignment="Left" Margin="6,26.25,0,0" Name="BusCostLabel" VerticalAlignment="Top" Width="58.75">Bus Cost</Label>

                    <Label Height="28" HorizontalAlignment="Left" Margin="3.75,91.25,0,0" Name="NumberOfBusesLabel" VerticalAlignment="Top" Width="100">Number of Buses</Label>
                    <Label Height="28" Margin="108.75,91.25,0,0" Name="NumberOfBusesDisplay" VerticalAlignment="Top" Content="{Binding Path=NumberOfBuses}" HorizontalAlignment="Left" Width="100" />
                    <Slider Height="22" Margin="0,91.25,20,0" Name="NumberOfBusesSlider" VerticalAlignment="Top" LargeChange="5" Maximum="100" Minimum="1" SmallChange="1" Value="{Binding Path=NumberOfBuses}" TickPlacement="TopLeft" HorizontalAlignment="Right" Width="521" />

                    <Label Height="28" HorizontalAlignment="Left" Margin="6,149.75,0,0" Name="TimeCostLabel" VerticalAlignment="Top" Width="72.5">Time Cost</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="70,143.75,0,0" Name="TimeCostDisplay" VerticalAlignment="Top" Width="139" Content="{Binding Path=TimeCost}"/>
                    <Slider Height="22" Margin="215,149.75,20,0" Name="TimeCostSlider" VerticalAlignment="Top" Maximum="50" Minimum="0" SmallChange="1" LargeChange="5" Value="{Binding Path=TimeCost}" TickFrequency="1" TickPlacement="TopLeft" />

                    <Label Height="28" HorizontalAlignment="Left" Margin="3.75,203.75,0,0" Name="DistanceCostLabel" VerticalAlignment="Top" Width="88.75">Distance Cost</Label>
                    <Label Height="28" Margin="97.5,203.75,0,0" Name="DistanceCostDisplay" VerticalAlignment="Top" HorizontalAlignment="Left" Width="111" Content="{Binding Path=DistanceCost}"/>
                    <Slider Height="22" Margin="215,209.75,6,0" Name="DistanceCostSlider" VerticalAlignment="Top" Maximum="1000" SmallChange="1" LargeChange="50"  TickPlacement="TopLeft" TickFrequency="10" Value="{Binding Path=DistanceCost}" />

                    <Label HorizontalAlignment="Left" Margin="3.75,258,0,284" Name="PassangerOverLoadCostLabel" Width="157.5">Passenger Overload Cost</Label>
                    <Label Margin="150,258,0,284" Name="PassangerOverLoadCostDisplay"  HorizontalAlignment="Left" Width="59" Content="{Binding Path=PassengerOverloadCost}" />
                    <Slider Margin="215,258,6,0" Name="PassangerOverLoadCostSlider" Height="22.04" VerticalAlignment="Top" LargeChange="100" Maximum="5000" SmallChange="1" TickFrequency="100" TickPlacement="TopLeft" Value="{Binding Path=PassengerOverloadCost}"/>

                    <Label Height="28" HorizontalAlignment="Left" Margin="6,0,0,225" Name="RiderOvertimeCostLabel" VerticalAlignment="Bottom" Width="120">Rider Overtime Cost</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="132,0,0,225" Name="RiderOvertimeCostDisplay" VerticalAlignment="Bottom" Width="77" Content="{Binding Path=RiderOvertimeCost}"/>
                    <Slider Height="22" Margin="0,0,6,225" Name="RiderOvertimeCostSlider" VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="535" LargeChange="100" Maximum="5000" SmallChange="1" TickFrequency="50" TickPlacement="TopLeft" Value="{Binding Path=RiderOvertimeCost}" />

                    <Label Height="28" HorizontalAlignment="Left" Margin="6,0,0,168" Name="PassengerLimitLabel" VerticalAlignment="Bottom" Width="97.75">Passenger Limit</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="109,0,0,168" Name="PassengerLimitDisplay" VerticalAlignment="Bottom" Width="99" Content="{Binding Path=PassengerLimit}"/>
                    <Slider Height="22" Margin="214,0,6,168" Name="PassengerLimitSlider" VerticalAlignment="Bottom" Maximum="60" Minimum="0" LargeChange="5" SmallChange="1" TickPlacement="TopLeft" Value="{Binding Path=PassengerLimit}" />

                    <Label Height="28" HorizontalAlignment="Left" Margin="6,0,0,116" Name="RiderTimeLimitLabel" VerticalAlignment="Bottom" Width="97.75">Rider Time Limit</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="109,0,0,116" Name="RiderTimeLimitDisplay" VerticalAlignment="Bottom" Width="100" Content="{Binding Path=RiderTimeLimit}"/>
                    <Slider Height="22" Margin="215,0,6,116" Name="RiderTimeLimitSlider" VerticalAlignment="Bottom" SmallChange="1" TickFrequency="5" TickPlacement="TopLeft" Value="{Binding Path=RiderTimeLimit}" Maximum="180" LargeChange="10" />

                    <Label Height="28" HorizontalAlignment="Left" Margin="6,0,0,63" Name="MutationRateLabel" VerticalAlignment="Bottom" Width="85">Mutation Rate</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="97,0,0,63" Name="MutationRateDisplay" VerticalAlignment="Bottom" Width="111" Content="{Binding Path=MutationRate}"/>
                    <Slider Height="22" Margin="214,0,0,69" Name="MutationRateSlider" VerticalAlignment="Bottom" Maximum="1" SmallChange="0.2" TickFrequency="0.01" TickPlacement="TopLeft" Value="{Binding Path=MutationRate}" />
                    
                    <Label Height="28" HorizontalAlignment="Left" Margin="6,0,0,19" Name="PopSizeLabel" VerticalAlignment="Bottom" Width="86.5">Population Size</Label>
                    <Label Height="28" HorizontalAlignment="Left" Margin="108.75,0,0,19" Name="PopSizeDisplay" VerticalAlignment="Bottom" Width="99.25" Content="{Binding Path=PopulationSize}"></Label>
                    <Slider Height="22" Margin="214,0,6,25" Name="PopSizeSlider" VerticalAlignment="Bottom" TickPlacement="TopLeft" SmallChange="5" Maximum="500" TickFrequency="10" LargeChange="50" Value="{Binding Path=PopulationSize}"/>
                </Grid>
            </TabItem>
            <TabItem Header="Map and Directions" Name="mapTab">
                <Grid>
                    <ComboBox Height="23" Margin="0,45,35,0" Name="RouteSchoolNameComboBox" VerticalAlignment="Top" ItemsSource="{Binding Schools}" SelectionChanged="RouteSchoolNameComboBox_SelectionChanged" HorizontalAlignment="Right" Width="191">
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=SchoolName}" />
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,11,106,0" Name="label6" VerticalAlignment="Top" Width="120">School</Label>
                    <ComboBox Height="23" HorizontalAlignment="Right" Margin="0,108,35,0" Name="comboBox2" VerticalAlignment="Top" Width="191" SelectionChanged="comboBox2_SelectionChanged" ItemsSource="{Binding Routes}">
                        <!--<ComboBox.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding Path=Routes}"/>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>-->
                    </ComboBox>
                    <Label Height="28" HorizontalAlignment="Right" Margin="0,74,106,0" Name="label7" VerticalAlignment="Top" Width="120">Route</Label>
                    <TextBox HorizontalAlignment="Right" Margin="0,157,35,246.716" Name="Directions" Width="190.045" TextWrapping="Wrap" AcceptsReturn="False" AcceptsTab="False" IsReadOnly="True" VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Auto" /> 
                    <Button Height="23" Margin="0,0,0,6" Name="PrintDirections" VerticalAlignment="Bottom" Click="PrintDirections_Click" HorizontalAlignment="Right" Width="226">Save Directions</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,0,70.014,135.027" Name="MapMoveUp" VerticalAlignment="Bottom" Width="75">UP</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,0,151,105.021" Name="MapMoveLeft" VerticalAlignment="Bottom" Width="75">Left</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,0,0,105.021" Name="MapMoveRight" VerticalAlignment="Bottom" Width="75">Right</Button>
                    <Button Height="23" HorizontalAlignment="Right" Margin="0,0,70.014,75.015" Name="MapMoveDown" VerticalAlignment="Bottom" Width="75">Down</Button>
                    <Grid Margin="12,10,243,16" Name="grid2" ClipToBounds="True">
                        <ScrollViewer HorizontalScrollBarVisibility="Visible" Width="600" Height="600">
                            <Canvas Height = "800" Width="800" Margin="3.334,6,232,6" Name="canvas1">
                            <Canvas.Background>
                                    <ImageBrush ImageSource="{Binding MapImage}" Stretch="None" />
                            </Canvas.Background>
                                
                            <Path Fill="Cyan" Stroke="Fuchsia" Data="{Binding RouteLines}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
                            </Canvas>
                        </ScrollViewer>
                    </Grid>
                    
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</Window>
